<template>
  <div class="llkz">
    <el-form ref="form" :rules="rules" :model="form" label-width="140px">
      <el-form-item label="每秒限流数" prop="mmxl">
        <el-input v-model="form.mmxl"></el-input>
      </el-form-item>
      <el-form-item label="每分限流数" prop="mfxl">
        <el-input v-model="form.mfxl"></el-input>
      </el-form-item>
      <el-form-item label="每小时限流数" prop="mxsxl">
        <el-input v-model="form.mxsxl"></el-input>
      </el-form-item>
      <el-form-item label="重试次数" prop="cscs">
        <el-input v-model="form.cscs"></el-input>
      </el-form-item>
      <el-form-item label="发布说明" prop="fbsm">
        <el-input
          type="textarea"
          :rows="4"
          resize="none"
          v-model="form.fbsm"
          maxlength="300"
          show-word-limit
        ></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  data () {
    return {
      form: {},
      rules: {
        mmxl: [
          { required: true, message: '请输入每秒限流数', trigger: 'blur' }
        ],
        mfxl: [
          { required: true, message: '请输入每分限流数', trigger: 'blur' }
        ],
        mxsxl: [
          { required: true, message: '请输入每小时限流数', trigger: 'blur' }
        ],
        cscs: [{ required: true, message: '请输入重试次数', trigger: 'blur' }],
        fbsm: [{ required: true, message: '请输入发布说明', trigger: 'blur' }]
      }
    }
  },
  mounted () {
    //
  },
  methods: {
    /*
     * 验证信息
     */
    validateForm () {
      return new Promise((resolve, reject) => {
        this.$refs.form.validate(el => {
          if (el) {
            resolve(this.form)
          } else {
            reject()
          }
        })
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.llkz {
  width: 100%;
  margin-top: 20px;
}
</style>
